﻿using System;
using System.Collections.Generic;
using System.Transactions;
using Bingosoft.Data;
using HHMMS.WorkFlow.Model;

namespace HHMMS.WorkFlow.Service
{
	/// <summary>
	///表示对表WorkflowActivity的所有操作的实现。
	/// </summary>
    public class ParticipantService
    {
        private readonly Dao dao = Dao.Get();

        private ParticipantService()
        { }

        private static ParticipantService instance = null;
        /// <summary>
        /// WorkflowActivity服务类的单例。
        /// </summary>
        public static ParticipantService Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (typeof(ParticipantService))
                    {
                        instance = new ParticipantService();
                    }
                }
                return instance;
            }
        }

        /// <summary>
        /// 获取结束环节。
        /// </summary>
        /// <param name="workflowId"></param>
        /// <returns></returns>
        public IList<User> GetUsresByRoleId(string roleId)
        {
            return this.dao.QueryEntities<User>("workflow.participant.getroleusers", new
            {
                RoleID = roleId
            });
        }
    }
}